package programmercarl.动态规划.C42;

import java.util.Arrays;

class Solution1 {
    public int findLengthOfLCIS(int[] nums) {
        int[] dp = new int[nums.length];//以i为结尾的最长连续递增子序列
        for (int i = 0; i < nums.length; i++) {
            dp[i] = 1;
        }
        int res = 1;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] > nums[i - 1]) {
                dp[i] = dp[i-1] + 1;
                res = Math.max(res, dp[i]);
            }
        }
        return res;
    }
}